import request from '@/utils/request'
// 文章详情
export const articles = id => {
  return request({
    url: '/v1_0/articles/' + id
  })
}
// 获取评论
export const comments = params => {
  return request({
    url: '/v1_0/comments',
    params,
    noCancel: true
  })
}
// 发表评论
export const commentsPost = data => {
  return request({
    url: '/v1_0/comments',
    method: 'post',
    data
  })
}
// 点赞接口
export const commentLikings = (data, isliking) => {
  if (!isliking) {
    return request({
      url: '/v1_0/comment/likings',
      method: 'post',
      data
    })
  } else {
    return request({
      url: '/v1_0/comment/likings' + data.target,
      method: 'delete'
    })
  }
}
